/*---------------------------------------------------------------------------
/*---------------------------------------------------------------------------
	ZaRan	-	A Totallly Automatic CFD Software
	Copyright (C) ,Since 2020
-------------------------------------------------------------------------------
License
	This file is part of ZaRan.

!	@file	ZaRanGridGenerator.h
!	@brief	Generate ZaRan Grid.
!	@author	Chen Jie.
\*---------------------------------------------------------------------------*/
#pragma once
#include"zaran_grid.h"
#include"model/include/model.h"
#include"Basic/include/ControlPara.h"
class ZaRanGridGenerator
{
public:
	void GenZaran2DGridFromModel(ZaranGrid& zaran_grid, Mod& mod, ContrlPara& contrl);
private:
	void GenBackGroundGrid();
	void GenBackGroundGridNode();
	void GenBackGroundGridNodeTag();
	void GenBackGroundGridNeiborNode();
	void GenBackGroundGridFaceAndElement();
	void GenBackGroundGridElementTag();
private:
	void FindTransitionNode();
	void FindTransitionFace();
private:
	void GenUnstructGrid();
	void GenUnstructGridBoundNode();
	void GenUnstructGridBoundLayerNode();
	void GenUnstructGridFaceAndElement();
	void GenUnstructGridNeiborNode();

private:
	bool IsTransitionNode(GridNode& node, Mod& mod, const double& min_dis);
private:
	ZaranGrid* zaranGrid_;
	Mod* mod_;
	ContrlPara* contrl_;
	vector<GridNode> transitionNodeVec_;
	vector<size_t>transitionNodeConnectUnstructSolidBoundNodeIndex_;
	vector<GridFace> transitionFaceVec_;
};